
import React from "react";
import { Space, Button } from "antd";


/**@description 会员等级列表表格字段 */
const getColumns = ({ open = Function, handleDelete = Function }) => {
    const columns = [
        
        {
            title: "会员等级",
            key: "id",
            dataIndex: "id",
            width: 180,
        },
        {
            title: "等级名称",
            key: "name",
            dataIndex: "name",
            width: 180,
        },
        {
            title: "折扣比例",
            key: "discountRatio",
            dataIndex: "discountRatio",
            width: 180,
        },
        {
            title: "操作",
            key: "action",
            dataIndex: "action",
            width: 280,
            render: (text, record) => {
                return <Space>
                    <Button type="link" onClick={() => open({ type: "update", record: record })}>编辑</Button>
                    <Button type="link" danger onClick={() => handleDelete(record)}>删除</Button>
                </Space>
            }
        }
    ];
    return columns;
}

export default getColumns;
    